﻿using System;

namespace _03_RefDemo
{
    internal class Program
    {
        public void Increment(ref int x)
        {
            x += 1;
        }
        static void Main(string[] args)
        {
            int x = 0;
            Console.WriteLine("未调用Increment之前x的值为：{0}", x);
            Console.WriteLine("调用Increment");
            Program p = new Program();
            p.Increment(ref x);
            Console.WriteLine("调用Increment之后x的值为：{0}", x);
            Console.ReadKey();
        }
    }
}
